Retain "htmlness" on cache description reads to that readers can spit them
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 1 Feb 2004 05:07:58 +0000 (05:07 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 1 Feb 2004 05:07:58 +0000 (05:07 +0000)
back out.

gpsbabel/defs.h
gpsbabel/gpx.c

index 46a13ed55e2ef2b4a4b93b2560e06cd0eec05f1b..5bd68dae487ce6c81b8abad0f6a4980c36956d39 100644 (file)
@@ -95,6 +95,11 @@ typedef enum {
        gc_virtual
 } geocache_container;
 
+typedef struct {
+       int is_html;
+       char *utfstring;
+} utf_string;
+
 typedef struct {
        geocache_type type;
        geocache_container container;
@@ -102,12 +107,10 @@ typedef struct {
        int terr; /* (likewise) */
        time_t exported;
        char *hint; /* all these UTF8, XML entities removed, May be not HTML. */
-       char *desc_short;
-       char *desc_long; 
+       utf_string desc_short;
+       utf_string desc_long; 
 } geocache_data ;
 
-
-
 typedef struct xml_tag {
        char *tagname;
        char *cdata;
@@ -391,6 +394,7 @@ void rtrim(char *s);
 signed int get_tz_offset(void);
 const char *get_cache_icon(const waypoint *waypointp);
 char * xml_entitize(const char * str);
+char * strip_html(const utf_string*);
 char * str_utf8_to_cp1252( const char * str );
 char * str_utf8_to_ascii( const char * str );
 
index 627e51b9a49791645d4305541a69cae1f9f65541..694b2ead7ca233070bb6b48f4c644a460d48f289 100644 (file)
@@ -610,13 +610,15 @@ gpx_end(void *data, const char *el)
        case tt_cache_desc_long:
                rtrim(cdatastrp);
                if (cdatastrp[0]) {
-                       wpt_tmp->gc_data.desc_long = xstrdup(cdatastrp);
+                       wpt_tmp->gc_data.desc_long.is_html = cache_descr_is_html;
+                       wpt_tmp->gc_data.desc_long.utfstring = xstrdup(cdatastrp);
                }
                break;
        case tt_cache_desc_short:
                rtrim(cdatastrp);
                if (cdatastrp[0]) {
-                       wpt_tmp->gc_data.desc_short = xstrdup(cdatastrp);
+                       wpt_tmp->gc_data.desc_short.is_html = cache_descr_is_html;
+                       wpt_tmp->gc_data.desc_short.utfstring = xstrdup(cdatastrp);
                }
                break;
        case tt_cache_terrain: